function flatten(input){
    let end = {}
    if(input instanceof Array){
        for(let i = 0; i < input.length; i++){
            if(input[i] instanceof Array){
                let returns = flatten(input[i]);
                for(let key in returns) {
                    end["[" + i + "]" + key] = returns[key];
                }
            }else if(input[i] instanceof Object){
                if(input[i] instanceof File){
                    end["[" + i + "]"] = input[i];
                }else{
                    let returns = flatten(input[i]);
                    for(let key in returns) {
                        end["[" + i + "]." + key] = returns[key];
                    }
                }
            }else{
                end["[" + i + "]"] = input[i];
            }
        }
    } else if(input instanceof Object){
        for(let key in input){
            if(input[key] instanceof Array){
                let returns = flatten(input[key]);
                for(let k in returns) {
                    end[key + k] = returns[k];
                }
            }else if(input[key] instanceof Object){
                if(input[key] instanceof File){
                    end[key] = input[key];
                }else{
                    let returns = flatten(input[key]);
                    for(let k in returns) {
                        end[key + "." + k] = returns[k];
                    }
                }
            }else{
                end[key] = input[key];
            }
        }
    }
    return end;
}
export default flatten